
//-----------------------------------------------
//              生成代码不要修改
//-----------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;

public class ActionInfoCfg
{
    public int id;    //		行为信息表
    public int type;    //		类型
    public int essenceType;    //		具体类型
    public string parameter;    //		参数定义
    public string parameter2;    //		参数定义
    public string parameter3;    //		参数定义
    public string parameter4;    //		参数定义
    public string parameter5;    //		参数定义

    public void Deserialize (DynamicPacket packet)
    {
        id = packet.PackReadInt32();
        type = packet.PackReadInt32();
        essenceType = packet.PackReadInt32();
        parameter = packet.PackReadString();
        parameter2 = packet.PackReadString();
        parameter3 = packet.PackReadString();
        parameter4 = packet.PackReadString();
        parameter5 = packet.PackReadString();
    }
}

public class ActionInfoCfgMgr
{
    private static ActionInfoCfgMgr mInstance;
    
    public static ActionInfoCfgMgr Instance
    {
        get
        {
            if (mInstance == null)
            {
                mInstance = new ActionInfoCfgMgr();
            }
            
            return mInstance;
        }
    }

    private Dictionary<int, ActionInfoCfg> mDict = new Dictionary<int, ActionInfoCfg>();
    
    public Dictionary<int, ActionInfoCfg> Dict
    {
        get {return mDict;}
    }

    public void Deserialize (DynamicPacket packet)
    {
        int num = (int)packet.PackReadInt32();
        for (int i = 0; i < num; i++)
        {
            ActionInfoCfg item = new ActionInfoCfg();
            item.Deserialize(packet);
            if (mDict.ContainsKey(item.id))
            {
                mDict[item.id] = item;
            }
            else
            {
                mDict.Add(item.id, item);
            }
        }
    }
    
    public ActionInfoCfg GetDataByid(int id)
    {
        if(mDict.ContainsKey(id))
        {
            return mDict[id];
        }
        
        return null;
    }
}
